#include "degfx/bitmap.h"

unsigned mx_bitmap_clip(MX_BITMAP * bitmap, const MX_RECT * newclip)
{
	if (newclip)
		MXRECT_INTERSECT(*newclip, *MXRECT(bitmap), bitmap->_clip);
	else
		bitmap->_clip = *MXRECT(bitmap);

	return MXRECT_VALID(bitmap->_clip) ? true : false;
}

const MX_RECT *mx_bitmap_clip_get(const MX_BITMAP * bitmap)
{
	return &bitmap->_clip;
}
